package com.nsoft.html5npub.utils;

import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.widget.ImageView;

public class LoadImageThread extends 
 			AsyncTask<Void,Integer,Void> {
	ImageView imageView;
	int bookIndex;
	Bitmap bmp;

	public LoadImageThread(ImageView _imgView, 
						int _bookIndex) {
		this.imageView=_imgView;
		this.bookIndex=_bookIndex;
	}

	@Override
	protected Void doInBackground(Void... params) {
		this.bmp=engine.getThumbFromBook(this.bookIndex);
		return null;
	}

	@Override
	protected void onPostExecute(Void result) {
		this.imageView.setImageBitmap(bmp);
	}
}
